<template>
<!-- <section class="app-main">
    <transition name="fade-transform" mode="out-in">
      <keep-alive :include="cachedViews"> //这是新增加的
        <router-view :key="key" />
      </keep-alive> //
    </transition>
  </section> -->
  <div id="app">
    
     <router-view  v-if="isRouterAlive" >
     </router-view>
  </div>
</template>

<script>
  export default {
    computed: {
    key() {
      return this.$route.path
    },
    cachedViews() {//这是新增加的
      return this.$store.state.tagsView.cachedViews
      // this.$store.state.tagsView.visitedViews
    }//
  },
    provide(){
      return{
        reload:this.reload
      }
    },
    data(){
      return{
        isRouterAlive:true,
        ismOrpc: true,
        data: {"width": 100, "height": 50,
        cfgs:[{"start": {"x":10 , "y": 5}, "end": {"x": 65, "y": 20}, "type": 1, "value": "地下停车场空闲枪数量："},
          {"start": {"x":70 , "y": 5}, "end": {"x": 90, "y": 20}, "type": 2, "value": "FreeCount"},
          {"start": {"x":10 , "y": 30}, "end": {"x": 65, "y": 45}, "type": 1, "value": "地下停车场使用中数量："},
          {"start": {"x":70 , "y": 30}, "end": {"x": 90, "y": 30}, "type": 2, "value": "UseCount"}]
        }
      }
    },
    created () {
      this.isMobile()
      //持久化登录
      // if(localStorage.User) {
      //   this.$store.commit({
      //     type: 'base/SET_USER_INFO',
      //     userInfo: JSON.parse(localStorage.User)
      //   })
      // }
    },
    
    methods:{
      isMobile() {
            let ismOrpc = navigator.userAgent.match(
                /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
            );
            
            if(ismOrpc === null) {
                ismOrpc = true;
            }else {
                ismOrpc = false
            }
            this.$store.commit('setIsropc',ismOrpc)
        },
      isEmpty(value) {
        return (
          value === undefined || value === null || (typeof value === 'object' && Object.keys(value).length === 0)
          || (typeof value === 'string' && value.trim().length === 0)
        )
      },
      reload(){
        this.isRouterAlive = false;
        this.$nextTick(function () {
          this.isRouterAlive = true;
        });
      },
    }
  }
</script>


<style>
html,body,#app {
  width: 100%;
  height: 100%;
  padding: 0;margin: 0;
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* overflow: hidden; */
}
  /* html{
    height: 100%;
  }
  body{
    min-height: calc(100% - 72px);
  } */

  html::-webkit-scrollbar {
  /*滚动条整体样式*/
  width : 10px;  /*高宽分别对应横竖滚动条的尺寸*/
  height: 1px;
  }
  html::-webkit-scrollbar-thumb {
  /*滚动条里面小方块*/
  border-radius: 10px;
  box-shadow   : inset 0 0 5px #324057;
  background   : #324057;
  }
  html::-webkit-scrollbar-track {
  /*滚动条里面轨道*/
  /* box-shadow   : inset 0 0 5px #324057; */
  border-radius: 10px;
  background   : #ededed;
  }

.el-input--medium .el-input__inner {
    height: 31px;
    line-height: 31px;
    /* width: 220px; */
}
.el-select-dropdown__item{
  height: auto!important;
}
</style>
